home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / cpu100.zip / TEST.C < prev    next >
C/C++ Source or Header  |  1993-04-14  |  1KB  |  52 lines

  1.     #include <conio.h>
  2.     #include <stdlib.h>
  3.     #include <dos.h>
  4.     #include <process.h>
  5.     #include "cpu.h"
  6.  
  7.     #define ROUND    1
  8.  
  9.  
  10.  
  11. void main(void)
  12.     {
  13.     static char *CPUS[]={
  14.         "Undetermined",
  15.         "8086/8088",
  16.         "8086/8088 with Coprocessor",
  17.         "80286",
  18.         "80286 with Coprocessor",
  19.         "i386tm",
  20.         "i386tm with 387 Coprocessor",
  21.         "i386tm with 87/287 Coprocessor",
  22.         "i486tm (SX)",
  23.         "i486tm (DX) or i487tm (SX) with Coprocessor",
  24.         NULL
  25.         };
  26.     static char *Protect[]={
  27.         "not in Protected",
  28.         "in Protected",
  29.         "in Protected mode via MS-Windows Enhanced",
  30.         NULL
  31.         };
  32.     static char *Windows[]={
  33.         "DOS",
  34.         "Windows/386 2.x",
  35.         "Windows 3.x in Enhanced mode",
  36.         "Windows 4.x in Enhanced mode",
  37.         "Windows/386 2.x",
  38.         "Windows 3.0 in Real mode or Windows 3.1+ in Standard mode",
  39.         "Windows 3.0 in Standard mode",
  40.         NULL
  41.         };
  42.     int cputype,pmode,win;
  43.     clrscr();
  44.     cputype=cpu();
  45.     win=iswin();
  46.     pmode=isprot();
  47.     cprintf("This machine has a %s.\n\rTesting processor speed...",CPUS[cputype]);
  48.     cprintf("\rIt has a processing speed of %s MHz.\n\r",cpuspeed(ROUND,cputype));
  49.     cprintf("The CPU is currently %s mode and is\n\rrunning under %s.\n\r",Protect[pmode],Windows[win]);
  50.     exit(0);
  51.     }
  52.